cmake_minimum_required(VERSION 3.19)
project(SoftwareRenderer)

set(CMAKE_INCLUDE_CURRENT_DIR ON)

set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

find_package(Qt5 COMPONENTS Widgets REQUIRED)

add_executable(SoftwareRenderer main.cpp MainWindow.cpp MainWindow.h WorkerThread.cpp WorkerThread.h Config.h Vertex.h Mesh.h Texture.h)

target_link_libraries(SoftwareRenderer Qt5::Widgets)

add_custom_command(
        TARGET SoftwareRenderer
        POST_BUILD
        COMMAND
        ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/test.gif $<TARGET_FILE_DIR:SoftwareRenderer>/
)